<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\DetailView;
use kartik\file\FileInput;

$this->title = '团队详情';

$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Costs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;

?>
<style type="text/css">
   .content-view{}
   .content-view .row{margin: 0;}
   .content-view .view-one{margin:5px;}
   .upload-file{margin-top: 20px;}
   .upload-file-button{float: right;}
   .offer-file{margin-top: 15px;}
   .cs1{margin:5px;} 
</style>
<div class="product-view">

   <div class="box">
        <div class="box-header">

        </div>
        <div class="box-body"> 
            <div class="content-view">
                <div class="row view-one">
                    <div class="col-md-4">
                        <label>客户名称：</label><?=$model->customer->name?>
                    </div> 
                    <div class="col-md-4">
                        <label>团队名称：</label><?=$model->name?>
                    </div>  
                    <div class="col-md-4">
                        <label>团号：</label><?=$model->code?>
                    </div>     
                </div> 
              
                <div class="row view-one">
                    
                    <div class="col-md-4">
                        <label>目的地城市：</label><?=$model->cityInfo?>
                    </div>  
                    <div class="col-md-4">
                        <label>抵离日期：</label><?=$model->begin_date.'/'.$model->end_date?>
                    </div>     
                </div> 
                <div class="row view-one">
                    <div class="col-md-4">
                        <label>团人数：</label><?=$model->num?> 人
                    </div> 
                    <div class="col-md-4">
                        <label>总收入：</label><?=$model->price?>
                    </div>  
                    <div class="col-md-4">
                        <label>总成本：</label><?=$model->costPrice?>
                    </div>     
                </div> 

                <div class="row view-one">
                    <div class="col-md-4">
                        <label>状态：</label><?=isset(Yii::$app->params['product_status'][$model->status])?Yii::$app->params['product_status'][$model->status]:''?>
                    </div> 
                    <div class="col-md-4">
                        <label>销售：</label><?=$model->userName?>
                    </div>  
                    <div class="col-md-4">
                        <label>操作：</label><?=$model->operName?>
                    </div>     
                </div> 

                <div class="row view-one">
                    <div class="col-md-4">
                        <label>创建时间：</label><?=$model->created_at?>
                    </div> 
                    <div class="col-md-4">
                        <label>更新时间：</label><?=$model->updated_at?>
                    </div>  
                    <div class="col-md-4">
                        <label>备注：</label><?=$model->remark?>
                    </div>     
                </div> 

            </div>  
                
          
            <div style="clear: both;"></div>

            <div class="offer-file">
                <table class="table table-bordered text-center">
                    <thead>
                        <tr>
                            <td>报价单文件名</td>
                            <td>报价总收入</td>
                            <td>次数</td>
                            <td>上传时间</td>
                            <td>操作</td>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($model->allLogs){ ?>
                            <?php foreach($model->allLogs as $key=>$log){ ?>
                                <tr>
                                    <td><?=$log->name?></td>
                                    <td><?=$log->price?></td>
                                    <td><?=$key+1?></td>
                                    <td><?=$log->created_at?></td>
                                    <td><a class="cs1 btn btn-success btn-xs" href="/product/log/download?id=<?=$log->id?>" >下载</a></td>
                                </tr>
                            <?php  }?>
                        <?php }?>
                    </tbody>
                </table>
            </div>    

        </div>
    </div>      
</div>

<?=  yii\web\View::registerJsFile("/js/layer/layer.js",['depends' => 'app\assets\AppAsset']) ?>

<?php app\components\JsBlock::begin() ?>
<script type="text/javascript">

$(document).ready(function () {
   
});

</script>
<?php app\components\JsBlock::end() ?>  